package com.hzw.saas.web.app.product.controller;

import com.hzw.saas.api.product.ITrialApplicationService;
import com.hzw.saas.api.product.query.TrialApplicationAddQuery;
import com.hzw.saas.common.config.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSort;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zzl
 * @since 2021/12/30
 */
@Controller
@Validated
@RequiredArgsConstructor
@Slf4j
@Api(tags = "产品中心/试用申请")
public class TrialApplicationController {

    private final ITrialApplicationService trialApplicationService;

    @PostMapping("/product/trial/application")
    @SysLog(operation = "软件使用申请提交",mode = 3)
    @ApiOperation(value = "软件使用申请提交", notes = "软件使用申请提交")
    @ApiOperationSort(1)
    public ResponseEntity<Void> postTrialApplication(@Validated @RequestBody TrialApplicationAddQuery param) {
        trialApplicationService.saveTrialApplication(param);
        return ResponseEntity.ok().build();
    }

}
